# Set this to the basename of the .tex file
# This will also be the name of the generated .dvi, .ps and .pdf files
PAPER = project2

# Set this to the other source files that should be counted as 
# dependencies
OTHERSOURCES := project.bib

# Set this to the basenames of the files containing figures
# !!! If you do not want to regenerate the figures, run "make FIGURES="
#FIGURES = bugchart  sessdoc  sessjist  sessws sessabl   sessdos  sesswd 
# WW: Wed Jul 21 15:16:37 PST 2004
# -- when I use "epstopdf" it makes PDF files that have "extra whitespace"
# that chops of the text in the resulting article

all: $(PAPER).pdf

.PHONY: pdf
pdf: $(PAPER).pdf

$(PAPER).pdf: $(PAPER).tex 
# Remove the .aux file because pdflatex wants it different
	rm -f $(PAPER).aux 
	if pdflatex $(PAPER).tex </dev/null; then \
		true; \
	else \
		stat=$$?; touch $(PAPER).pdf; exit $$stat; \
	fi
	bibtex $(PAPER)
	while grep "Rerun to get cross" $(PAPER).log; do \
		if pdflatex $(PAPER).tex </dev/null; then \
			true; \
		else \
			stat=$$?; touch $(PAPER).pdf; exit $$stat; \
		fi; \
	done


$(PAPER).ps: $(PAPER).pdf
	pdf2ps $(PAPER).pdf

clean:
	rm -f *.aux *.log project2.ps *.dvi *.blg *.bbl *.toc *~ *.out project2.pdf
